home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / feel-075.lha / feel0.75 / Src / error.h < prev    next >
C/C++ Source or Header  |  1992-06-18  |  4KB  |  129 lines

  1. /* ******************************************************************** */
  2. /*  error.h          Copyright (C) Codemist and University of Bath 1989 */
  3. /*                                                                      */
  4. /* Error and Signal handling                                            */
  5. /* ******************************************************************** */
  6.  
  7. /*
  8.  * Change Log:
  9.  *   Version 1, April 1989
  10.  */
  11.  
  12.  
  13. #ifndef ERROR_H
  14. #define ERROR_H
  15.  
  16. #ifndef SETJMP_H
  17. #define SETJMP_H
  18. #include <setjmp.h>
  19. #endif
  20.  
  21. typedef struct { Env env; jmp_buf buf; } Restarts;
  22.  
  23. extern Restarts read_eval_print_loop;
  24.  
  25. #define is_condition(op) (EUCALL_2(Fn_subclassp,classof(op),Default_Condition)!=nil)
  26.  
  27. LispObject CallError(LispObject *, char *, LispObject, int);
  28. void signal_message(LispObject *,int,char *,LispObject);
  29. void signal_heap_failure(LispObject *, int);
  30.  
  31. extern LispObject function_default_handler;
  32. /* condition representation */
  33.  
  34. #define condition_message(x) (slotref((x),0))
  35. #define condition_error_value(x) (slotref((x),1))
  36.  
  37.  
  38. /* The conditions, used as index into table */
  39.  
  40. #define INTERNAL_ERROR            (0)
  41.  
  42. #define UNBOUND_LEXICAL_VARIABLE    (1)
  43. #define UNBOUND_DYNAMIC_VARIABLE    (2)
  44. #define INVALID_OPERATOR        (3)
  45. #define NO_UPDATE_FUNCTION        (4)
  46. #define IMMUTABLE_BINDING        (5)
  47. #define NO_BLOCK_FOR_RETURN        (6)
  48. #define NO_CATCH_FOR_THROW        (7)
  49.  
  50. #define CLOCK_TICK            (8)
  51. #define DEAD_CONTINUATION        (9)
  52. #define DEAD_THREAD            (10)
  53. #define THREAD_OVERFLOW            (11)
  54. #define THREAD_UNDERFLOW        (12)
  55.  
  56. #define CANNOT_MAKE_ARRAY        (13)
  57. #define CANNOT_MAKE_CHARACTER        (14)
  58. #define CANNOT_MAKE_CHARACTER_SET    (15)
  59. #define CANNOT_MAKE_FLOAT        (16)
  60. #define CANNOT_MAKE_NUMBER        (17)
  61. #define CANNOT_MAKE_PAIR        (18)
  62. #define CANNOT_MAKE_READTABLE        (19)
  63. #define CANNOT_MAKE_STREAM        (20)
  64. #define CANNOT_MAKE_STRING        (21)
  65. #define CANNOT_MAKE_SYMBOL        (22)
  66. #define CANNOT_MAKE_TABLE        (23)
  67. #define CANNOT_MAKE_THREAD        (24)
  68.  
  69. #define FLOATING_OVERFLOW        (25)
  70. #define FLOATING_UNDERFLOW        (26)
  71. #define INTEGER_OVERFLOW        (27)
  72. #define INTEGER_UNDERFLOW        (28)
  73. #define NOT_A_NUMBER            (29)
  74.  
  75. #define NON_EXISTENT_FILE_OR_DEVICE    (30)
  76. #define NOT_AN_INPUT_DEVICE        (31)
  77. #define NOT_AN_INPUT_STREAM        (32)
  78. #define NOT_AN_OUTPUT_DEVICE        (33)
  79. #define CANNOT_ACCESS_FILE        (34)
  80. #define CANNOT_APPEND_TO_DEVICE        (35)
  81.  
  82. #define SLOT_UNBOUND                    (36)
  83. #define SLOT_MISSING                    (37)
  84. #define BAD_SLOT_INDEX                  (38)
  85. #define NO_LAMBDA_LIST                  (39)
  86. #define NON_ALLOCATABLE_OBJECT          (40)
  87. #define NO_APPLICABLE_METHOD            (41)
  88. #define NON_CONGRUENT_LAMBDA_LISTS      (42)
  89.  
  90. #define CANNOT_MAKE_VECTOR              (43)
  91.  
  92. #define HEAP_EXHAUSTED                  (44)
  93.  
  94. #define    UNINITIALIZED_LEXICAL_VARIABLE    (45)
  95. #define    CANNOT_ASSIGN_VARIABLE        (46)
  96. #define    INVALID_OPERANDS        (47)
  97. #define    IMMUTABLE_LOCATION        (48)
  98. #define    CANNOT_MODIFY_EMPTY_LIST    (49)
  99. #define    NAME_CLASH_IN_MODULE        (50)
  100. #define    CANNOT_UNQUOTE_SPLICE        (51)
  101. #define    SEMAPHORE_ALREADY_DOWN        (52)
  102. #define    CANNOT_MAKE_FUNCTION        (53)
  103. #define    CANNOT_MAKE_IO_STREAM        (54)
  104. #define    CANNOT_MAKE_STRUCTURE_CLASS    (55)
  105. #define    CANNOT_OPEN_PATH        (56)
  106. #define    FILE_ALREADY_EXISTS        (57)
  107. #define    INCONSISTENT_OPEN_OPTIONS    (58)
  108. #define    INVALID_STREAM_POSITION        (59)
  109. #define    NOT_AN_OUTPUT_STREAM        (60)
  110. #define    NOT_AN_IO_STREAM        (61)
  111. #define    NOT_A_CHARACTER_STREAM        (62)
  112. #define    NOT_A_BINARY_STREAM        (63)
  113. #define    NOT_A_POSITIONABLE_STREAM    (64)
  114. #define    PATH_DOES_NOT_EXIST        (65)
  115. #define    STREAM_NOT_OPEN            (66)
  116. #define    NON_CONGRUENT_LAMBDA_LIST    (67)
  117. #define    NO_NEXT_METHOD            (68)
  118. #define    METHOD_IN_USE            (69)
  119. #define    INVALID_RETURN_CONTINUATION    (70)
  120. #define    INVALID_THROW_CONTINUATION    (71)
  121. #define    CANNOT_MAKE_TOKENISER        (72)
  122. #define    BAD_METHOD_CLASS        (73)
  123.  
  124. #define Reader_CallError(sp,msg,val,foo) \
  125.   (ON_collect(), CallError(sp,msg,val,foo))
  126.  
  127. #endif /* ERROR_H */
  128. /* end of error.h */
  129.